//package com.fengzai.demo.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.fengzai.netty.common.cache.SocketChannelCache;
//import com.fengzai.netty.tcp.DefaultTcpClient;
//import com.fengzai.netty.udp.UdpClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * @PACKAGE_NAME: com.fengzai.demo.controller
// * @author: rhf
// * @ProjectName: netty
// * @DATE: 2021/10/11
// **/
//@RestController
//@RequestMapping("/test/")
//public class TestController {
//    @Autowired
//    private UdpClient udpClient;
//    @Autowired
//    private DefaultTcpClient tcpClient;
//
//    @GetMapping("sendMsg")
//    public String sendUdpMsg(String msg) {
//        udpClient.send(msg, "127.0.0.1", 10001);
//        return "ok";
//    }
//
//    @GetMapping("sendTcpMsg")
//    public String sendTcpMsg(String msg) {
//        tcpClient.send(msg, "001");
//        return "ok";
//    }
//
//    @GetMapping("getChannels")
//    public String getChannels() {
//        System.out.println(JSONObject.toJSON(SocketChannelCache.all()));
//        return "ok";
//    }
//}
